home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Freeware 1998 June
/
SGI Freeware 1998 June.iso
/
dist
/
fw_ATxgopher.idb
/
usr
/
freeware
/
src
/
xgopher.1.3
/
MIT-Xos.h.z
/
MIT-Xos.h
Wrap
C/C++ Source or Header
|
1998-01-21
|
4KB
|
172 lines
/*
* =======================================================================
* This file is as supplied by MIT in the X11R5 distribution
* except for 1) having its name changed from Xos.h to MIT-Xos.h;
* 2) checking to not re-define macros if the system include files
* already took care of this (e.g., index/rindex); and 3) adding
* a check for ISC 3.0 in two places (symbol ISCX)
* =======================================================================
* $XConsortium: Xos.h,v 1.47 91/08/17 17:14:38 rws Exp $
*
* Copyright 1987 by the Massachusetts Institute of Technology
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of M.I.T. not be used in advertising
* or publicity pertaining to distribution of the software without specific,
* written prior permission. M.I.T. makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* The X Window System is a Trademark of MIT.
*
*/
/* This is a collection of things to try and minimize system dependencies
* in a "signficant" number of source files.
*/
#ifndef _XG_XOS_H_
#define _XG_XOS_H_
#include "MIT-Xosdefs.h"
/*
* Get major data types (esp. caddr_t)
*/
#ifdef USG
#ifndef __TYPES__
#ifdef CRAY
#define word word_t
#endif /* CRAY */
#include <sys/types.h> /* forgot to protect it... */
#define __TYPES__
#endif /* __TYPES__ */
#else /* USG */
#if defined(_POSIX_SOURCE) && defined(MOTOROLA)
#undef _POSIX_SOURCE
#include <sys/types.h>
#define _POSIX_SOURCE
#else
#include <sys/types.h>
#endif
#endif /* USG */
/*
* Just about everyone needs the strings routines. We provide both forms here,
* index/rindex and strchr/strrchr, so any systems that don't provide them all
* need to have #defines here.
*/
#ifndef X_NOT_STDC_ENV
#include <string.h>
#ifndef index
#define index strchr
#endif
#ifndef rindex
#define rindex strrchr
#endif
#else
#ifdef SYSV
#include <string.h>
#ifndef index
#define index strchr
#endif
#ifndef rindex
#define rindex strrchr
#endif
#else
#include <strings.h>
#ifndef strchr
#define strchr index
#endif
#ifndef strrchr
#define strrchr rindex
#endif
#endif
#endif
/*
* Get open(2) constants
*/
#ifdef X_NOT_POSIX
#include <fcntl.h>
#ifdef USL
#include <unistd.h>
#endif /* USL */
#ifdef CRAY
#include <unistd.h>
#endif /* CRAY */
#ifdef MOTOROLA
#include <unistd.h>
#endif /* MOTOROLA */
#ifdef SYSV386
#include <unistd.h>
#endif /* SYSV386 */
#include <sys/file.h>
#else /* X_NOT_POSIX */
#if !defined(_POSIX_SOURCE) && defined(macII)
#define _POSIX_SOURCE
#include <fcntl.h>
#undef _POSIX_SOURCE
#else
#include <fcntl.h>
#endif
#include <unistd.h>
#endif /* X_NOT_POSIX else */
/*
* Get struct timeval
*/
#ifdef SYSV
#ifndef USL
#include <sys/time.h>
#endif
#include <time.h>
#ifdef CRAY
#undef word
#endif /* CRAY */
#if defined(USG) && !defined(CRAY) && !defined(MOTOROLA) && !defined(ISCX)
struct timeval {
long tv_sec;
long tv_usec;
};
#if !defined(USL_SHARELIB) && !defined(ISCX)
struct timezone {
int tz_minuteswest;
int tz_dsttime;
};
#endif /* USL_SHARELIB */
#endif /* USG */
#else /* not SYSV */
#if defined(_POSIX_SOURCE) && defined(SVR4)
/* need to omit _POSIX_SOURCE in order to get what we want in SVR4 */
#undef _POSIX_SOURCE
#include <sys/time.h>
#define _POSIX_SOURCE
#else
#include <sys/time.h>
#endif
#endif /* SYSV */
/* use POSIX name for signal */
#if defined(X_NOT_POSIX) && defined(SYSV) && !defined(SIGCHLD)
#define SIGCHLD SIGCLD
#endif
#ifdef ISC
#include <sys/bsdtypes.h>
#endif
#endif /* _XG_XOS_H_ */